<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="org.apache.http.client.HttpClient" %>
<%@ page import="org.apache.http.client.ResponseHandler" %>
<%@ page import="org.apache.http.client.methods.HttpPost" %>
<%@ page import="org.apache.http.entity.StringEntity" %>
<%@ page import="org.apache.http.impl.client.BasicResponseHandler" %>
<%@ page import="org.apache.http.impl.client.DefaultHttpClient" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<%
		String xml = "<PACKET type='REQUEST' version='1.0'><HEAD><REQUEST_TYPE>62</REQUEST_TYPE><COM_CODE>918</COM_CODE><USER>yl</USER><PASSWORD>yl123</PASSWORD><INTERIONAL_STANDARD_CODE/></HEAD><BODY><ORDER_DTO><POA_CODE/><POA_TYPE>c</POA_TYPE><PAY_METHOD/><MERCHANT_ID/><OPERATOR_CODE>55555</OPERATOR_CODE><ITEM_DTO_LIST><ITEM_DTO><BUSINESS_NO>2180012242012000212</BUSINESS_NO></ITEM_DTO><ITEM_DTO><BUSINESS_NO>2180010022012000329</BUSINESS_NO></ITEM_DTO></ITEM_DTO_LIST></ORDER_DTO></BODY></PACKET>";
		String url ="http://10.2.19.183:7001/HtcpOSBServices/PayPacketing";
		HttpClient httpclient = new DefaultHttpClient();
		HttpPost httppost = new HttpPost(url);
		StringEntity entity = new StringEntity(xml,"GBK");
		httppost.setEntity(entity);
		httppost.setHeader("Content-type", "text/xml;charSet=GBK");
		
		ResponseHandler<String> responseHandler = new BasicResponseHandler();
		Date startDate = new Date();
		out.println("调用中台接口开始时间："+startDate.toString());
		String  responseStr = httpclient.execute(httppost,responseHandler);
		Date endDate = new Date();
		out.println("调用中台接口结束时间："+endDate.toString());
		long between=endDate.getTime()-startDate.getTime();
		out.println("共用毫秒数："+between);
		out.println(responseStr);

%>
